import request from '@/utils/request'

// 查询流水号配置列表
export function listPager(query) {
    return request({
        url: '/lims/pageConfig/package/list',
        method: 'get',
        params: query
    })
}

// 查询流水号配置详细
export function getPager(cPId) {
    return request({
        url: '/lims/pageConfig/package/' + cPId,
        method: 'get'
    })
}

// 新增流水号配置
export function addPager(data) {
    return request({
        url: '/lims/pageConfig/package',
        method: 'post',
        data: data
    })
}

// 删除流水号配置
export function delPager(cPId) {
    return request({
        url: '/lims/pageConfig/package/delete/' + cPId,
        method: 'delete'
    })
}

// 复制
export function copyPager(query) {
    return request({
        url: '/lims/pageConfig/package/copy',
        method: 'get',
        params: query
    })
}

export function getPagerList(query) {
    return request({
        url: '/lims/pageConfig/packageList',
        method: 'get',
        params: query
    })
}

// 查询模板
export function listTemple() {
    return request({
        url: '/lims/pageConfig/tableList',
        method: 'get'
    })
}

// 模板级联原始记录字段
export function listYsjlZd(tableId) {
    return request({
        url: '/lims/pageConfig/componentList/' + tableId,
        method: 'get'
    })
}

// 查询流水号配置列表
export function listTextConfig(query) {
    return request({
        url: '/lims/pageConfig/data/list',
        method: 'get',
        params: query
    })
}

// 查询流水号配置列表
export function listRecordsConfig(query) {
    return request({
        url: '/lims/pageConfig/template/list',
        method: 'get',
        params: query
    })
}

// 新增流水号列表
export function addPagerConfig(data) {
    return request({
        url: '/lims/pageConfig/data',
        method: 'post',
        data: data
    })
}

// 新增流水号列表
export function addRecordsConfig(data) {
    return request({
        url: '/lims/pageConfig/template',
        method: 'post',
        data: data
    })
}

// 删除流水号列表
export function delPagerConfig(dataId) {
    return request({
        url: '/lims/pageConfig/data/delete/' + dataId,
        method: 'delete'
    })
}

// 删除流水号列表
export function delRecordsConfig(tableId, cPId) {
    return request({
        url: '/lims/pageConfig/template/delete/' + tableId + '/' + cPId,
        method: 'delete'
    })
}

// 编辑流水号列表
export function getPagerConfigForm(dataId) {
    return request({
        url: '/lims/pageConfig/data/' + dataId,
        method: 'get'
    })
}

// 编辑流水号列表
export function getRecordsConfigForm(tableId, cPId) {
    return request({
        url: '/lims/pageConfig/template/'  + tableId + '/' + cPId,
        method: 'get'
    })
}

// 查询流水号
export function getSerialNum(query) {
    return request({
        url: '/system/serial/max/data',
        method: 'get',
        params: query
    })
}

// 获取仪器型号下拉框
export function getSelection(query) {
    return request({
        url: '/lims/pageConfig/instrumentList',
        method: 'get',
        params: query
    })
}
